package com.scy.java.object.abstractTest;
//测试几何图形计算面积
public class ShapeDemo {
    public static void main(String[] args) {
//        Square square = new Square(5, 5);
//        System.out.println("正方形的面积为："+square.area());
//        Triangle triangle = new Triangle(2, 5);
//        System.out.println("三角形的面积为："+triangle.area());
        Shape shape = new Square(4, 4);
        System.out.println(shape.area());
        Shape shape1 = new Triangle(2,4);
        System.out.println(shape1.area());
    }
}
